package com.huifaapp.mall.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;


import com.huifaapp.mall.activity.HotSearchFragment;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by DM on 2018/1/26.
 */

public class HotSearchClassifyViewPagerAdapter extends FragmentPagerAdapter {
    private List<HotSearchFragment> hotSearchFragmentList = new ArrayList<>();
    public HotSearchClassifyViewPagerAdapter(FragmentManager fm,List<HotSearchFragment> hotSearchFragmentList) {
        super(fm);
        this.hotSearchFragmentList = hotSearchFragmentList;
    }

    @Override
    public Fragment getItem(int position) {
        return hotSearchFragmentList.get(position);
    }

    @Override
    public int getCount() {
        return hotSearchFragmentList.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return hotSearchFragmentList.get(position).getFragmentTitle();
    }
}
